import 'package:base_flutter/base_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/src/widgets/framework.dart';

import '../viewmodel/select_building_floor_view_model.dart';

class SelectBuildingFloorPage extends BaseStatefulMvvmWidget {
  final bool needBack;
  Function(String buildingId, String floorId, String buildingName,
      String floorName)? callback;

  SelectBuildingFloorPage({this.needBack = false, this.callback});

  @override
  State<StatefulWidget> createState() => _SelectBuildingFloorState();
}

class _SelectBuildingFloorState extends BaseMvvmState<
    SelectBuildingFloorViewModel, SelectBuildingFloorPage> {
  @override
  Widget buildLoadingContentView() {
    return viewModel.contentView();
  }

  @override
  Widget buildRootView(BuildContext context, Widget loadingContentWidget) {
    return Scaffold(
      appBar: AppBar(
        title: Text('选择楼层'),
      ),
      body: loadingContentWidget,
    );
  }

  @override
  SelectBuildingFloorViewModel createViewModel() {
    return SelectBuildingFloorViewModel(context,
        needBack: widget.needBack, callback: widget.callback);
  }

  @override
  void onRetryClick() {}
}
